package com.aplink.generic.pojo;

import java.io.Serializable;

import com.aplink.generic.constant.type.ColumnType;
import com.aplink.generic.pojo.controlspec.ValueList;
import com.aplink.generic.pojo.controlspec.menu.PopupMenuSpec;

public class ColumnSetting implements Serializable {
    private static final long serialVersionUID = -4557607144479072572L;
    public static final String STATIC_RESOURCE = "{StaticResource}";
    public static final String TAG_EMPTY = "";
    private boolean isStaicResource;
    private String mColType;
    private String mDataObj;
    private String mFormat;
    private String mHeaderText;
    private String mLinkMappingName;
    private String mLinkPage;
    private String mMappingName;
    private PopupMenuSpec mPopupMenuSpec;
    private ValueList mValueList;

    public ColumnSetting() {
        this.mColType = ColumnSetting.TAG_EMPTY;
        this.mMappingName = ColumnSetting.TAG_EMPTY;
        this.mLinkMappingName = ColumnSetting.TAG_EMPTY;
        this.mLinkPage = ColumnSetting.TAG_EMPTY;
        this.mHeaderText = ColumnSetting.TAG_EMPTY;
        setPopupMenuSpec(new PopupMenuSpec());
    }

    public ColumnType getColType() {
        return ColumnType.get(this.mColType);
    }

    public String getColumnName() {
        return String.format("%s.%s", this.mDataObj, this.mMappingName);
    }

    public String getDataObj() {
        return this.mDataObj;
    }

    public String getFormat() {
        return this.mFormat;
    }

    public String getHeaderText() {
        return this.mHeaderText;
    }

    public String getLinkMappingName() {
        return this.mLinkMappingName;
    }

    public String getLinkPage() {
        return this.mLinkPage;
    }

    public String getMappingName() {
        return this.mMappingName;
    }

    public PopupMenuSpec getPopupMenuSpec() {
        return this.mPopupMenuSpec;
    }

    public ValueList getValueList() {
        return this.mValueList;
    }

    public boolean hasValueList() {
        if (this.mValueList == null) {
            return false;
        }
        return !this.mValueList.isEmpty();
    }

    public boolean isStaicResource() {
        return this.isStaicResource;
    }

    public void setColType(final String colType) {
        this.mColType = colType;
    }

    public void setDataObj(final String dataObj) {
        this.mDataObj = dataObj;
    }

    public void setFormat(final String format) {
        this.mFormat = format;
    }

    public void setHeaderText(final String headertext) {
        this.mHeaderText = headertext;
    }

    public void setLinkMappingName(final String linkmappingname) {
        this.mLinkMappingName = linkmappingname;
    }

    public void setLinkPage(final String linkpage) {
        this.mLinkPage = linkpage;
    }

    public void setMappingName(final String mappingname) {
        this.mMappingName = mappingname;
    }

    public void setPopupMenuSpec(final PopupMenuSpec popupMenuSpec) {
        this.mPopupMenuSpec = popupMenuSpec;
    }

    public void setStaicResource(final boolean isStaicResource) {
        this.isStaicResource = isStaicResource;
    }

    public void setValueList(final ValueList valueList) {
        this.mValueList = valueList;
    }
}
